Questions
8 of 14
1What does HNSW stand for, and at a high level, how does it achieve sub-linear approximate nearest-neighbor search?
2What do the HNSW parameters m and ef_construct control, and what trade-off do they represent?
3What does the query-time parameter ef (search breadth) control, and how would you use it to trade off recall against latency?
4Why might increasing m significantly improve recall on one dataset but barely help - or even hurt latency - on another?
5Why does Qdrant set m: 0 on a named vector used purely for reranking (e.g. a ColBERT multivector)?
6What problem does vector quantization solve, and what is the fundamental trade-off it introduces?
7Compare scalar quantization, product quantization, and binary quantization in Qdrant in terms of compression ratio and accuracy impact.
8What are oversampling and rescoring in the context of binary quantization, and why are they necessary?
9What newer quantization options - beyond the original scalar, product, and binary trio - has Qdrant introduced to fine-tune the compression/accuracy curve?
10What is Inline Storage, and how does embedding quantized vectors directly into HNSW graph nodes improve disk-based search performance?
11What is a multivector point, and how does it differ from a point with several named vectors?
12How does late-interaction scoring (as used by ColBERT-style models) with MaxSim differ from comparing two single dense vectors?
13Why is late-interaction reranking typically applied to a small candidate set rather than the entire collection?
14Design a three-stage retrieval pipeline using dense retrieval, sparse retrieval, fusion, and ColBERT reranking. What does each stage contribute?
08 / 14

What are oversampling and rescoring in the context of binary quantization, and why are they necessary?

Oversampling retrieves extra candidates; rescoring re-ranks them with full precision

Oversampling and rescoring are the two techniques that make binary quantization usable. Binary quantization reduces each dimension to a single bit, so the quantized distance between two vectors is a very coarse approximation of the true distance. If you use it directly to rank a candidate set and take the top-k, you will get a ranking that is noisy near the decision boundary, and the true nearest neighbors will often be pushed out of the top-k by near-duplicates that happened to quantize favorably. Oversampling means retrieving more candidates than you actually need - say 3x or 5x the limit - using the fast quantized distance. Rescoring means taking that larger candidate set and re-ranking it using the full-precision vectors, which are still stored in the collection, to recover the accurate ordering. The combination is what gives BQ its characteristic profile: nearly the memory of binary, with recall close to full precision.

The mechanism is a classic retrieve-then-rerank pattern applied at the quantization layer. The quantized distance is good enough to separate the candidate set into approximately the right region of the space - it has high recall at the coarse level - but not good enough to order vectors that are close together. So you use it to cast a wide net, then you pay the cost of full-precision distance computation on a small number of candidates to get the final ordering. The oversampling factor is the key parameter: too low and the true nearest neighbors are not in the candidate set, so rescoring cannot recover them; too high and you pay for full-precision distance computations on candidates that had no chance. The right factor depends on the intrinsic dimensionality of the data and on how aggressive the quantization is. For binary quantization on 1024-dim normalized embeddings, an oversampling factor of 2-4 is typical. For lower-dimensional data or for higher compression schemes (sub-byte), you may need more.

  1. 1

    Oversampling: retrieve limit * oversampling candidates using the quantized distance. Improves recall at the coarse stage.

  2. 2

    Rescoring: re-rank the oversampled candidate set using full-precision vectors. Recovers accuracy at the fine stage.

  3. 3

    Both are query-time settings, so you can tune them per request without rebuilding the index.

  4. 4

    Rescoring requires the full-precision vectors to be available at query time. If you have dropped them (some configurations store only quantized vectors), rescoring is impossible.

The trade-off is recall against latency. Oversampling multiplies the candidate set size, which increases the cost of the rescoring step linearly. Rescoring adds a full-precision distance computation per candidate, which is 4x to 32x more expensive per comparison than the quantized distance, depending on the scheme. So the combination can be several times slower than a pure quantized search, but still much faster than full-precision HNSW over the whole collection - the point is that you are only rescoring a small candidate set, not the whole collection. The common mistake is enabling binary quantization without rescoring and concluding that BQ is unusable. BQ without rescoring is not a fair test; the whole design assumes rescoring is on. The second common mistake is setting the oversampling factor too high by default. Oversampling is cheap in memory but not in CPU, and on a high-QPS endpoint a factor of 10 can dominate the latency budget. Start at 2-3 and measure. The third mistake is forgetting that rescoring depends on full-precision vectors being stored. If your collection is configured to store only quantized vectors (e.g. to save disk), rescoring will silently fall back or fail depending on the version. Version note: the default oversampling factor and the exact semantics of QuantizationSearchParams have changed across Qdrant releases, so set them explicitly rather than relying on defaults.

javascript

Version-dependent: binary quantization, QuantizationSearchParams, and the oversampling field are all relatively recent additions to Qdrant and have continued to evolve. The exact default oversampling factor and whether rescoring is on by default differ by version. Always set both explicitly in performance-critical code, and re-benchmark after upgrading the server or the client.

Difficulty: 8/10
Topics: Quantization, Binary Quantization, Oversampling and Rescoring

Scenario Questions

0-2 years experience
  1. 1

    You enable BQ and set oversampling=1 with rescore=True. Explain why recall barely improves compared to rescore=False.

  2. 2

    A teammate says oversampling is a free recall boost. Explain the cost and why you cannot just set it to 100.

2-5 years experience
  1. 1

    You enable BQ with oversampling=3 and rescore=True on a collection and p99 latency triples. Diagnose which component is responsible and propose two ways to reduce latency without dropping recall below target.

  2. 2

    You have a 20ms p99 budget and a 0.95 recall target. Walk through how you would find the (oversampling, rescore) configuration that satisfies both.

5-8 years experience
  1. 1

    Design a query planner that adaptively chooses the oversampling factor based on query difficulty and current load. What signals would you use, and how would you prevent the planner from oscillating?

  2. 2

    You must serve the same collection with two SLAs: a 5ms p99 tier and a 50ms p99 tier. How do you configure oversampling and rescoring for each tier without duplicating storage?

8+ years experience
  1. 1

    Derive the recall of BQ with oversampling k and rescoring as a function of the per-dimension error rate and the intrinsic dimensionality of the data. Where does the model predict diminishing returns, and how would you validate that prediction empirically?

  2. 2

    You are asked to replace full-precision HNSW with BQ + oversampling + rescoring to cut memory by 32x. Describe the conditions under which this is a net win and the conditions under which it is a net loss, with a quantitative framework for deciding.

Follow-up Questions

  • How do you choose the oversampling factor for a specific dataset, and what does the recall-vs-oversampling curve look like in practice?
  • What happens to rescoring if you configure the collection to store only quantized vectors, and how would you detect that misconfiguration before it affects users?